using System;
using System.Collections.Generic;
using System.Text;
using Shc.Sql;
using Shc.Json;
namespace CLZ.Data
{
	public static class TableGiftCardsHistory
	{
		public const string Table = "GiftCardsHistory";
		public const string GiftCardsHistoryID = "GiftCardsHistoryID";
		public const string GiftCardsID = "GiftCardsID";
		public const string CardNumber = "CardNumber";
		public const string Amount = "Amount";
		public const string StatusID = "StatusID";
		public const string Validity = "Validity";
		public const string Remarks = "Remarks";
		public const string Creater = "Creater";
		public const string CreatedBy = "CreatedBy";
		public const string Created = "Created";
		public const string Modified = "Modified";
		public const string ModifiedBy = "ModifiedBy";
		public const string ModifiedByID = "ModifiedByID";
	}
	
	[Serializable]
	public class BaseGiftCardsHistory
		: IDbSessionEntity, IJsonClass
	{
		int m_GiftCardsHistoryID;
		/// <summary>
        /// 
        /// </summary>
        public int GiftCardsHistoryID
        {
            get { return m_GiftCardsHistoryID; }
            set { m_GiftCardsHistoryID = value; }
        }
		
		int m_GiftCardsID;
		/// <summary>
        /// 
        /// </summary>
        public int GiftCardsID
        {
            get { return m_GiftCardsID; }
            set { m_GiftCardsID = value; }
        }
		
		string m_CardNumber;
		/// <summary>
        /// 
        /// </summary>
        public string CardNumber
        {
            get { return m_CardNumber; }
            set { m_CardNumber = value; }
        }
		
		double m_Amount;
		/// <summary>
        /// 
        /// </summary>
        public double Amount
        {
            get { return m_Amount; }
            set { m_Amount = value; }
        }
		
		int m_StatusID;
		/// <summary>
        /// 
        /// </summary>
        public int StatusID
        {
            get { return m_StatusID; }
            set { m_StatusID = value; }
        }
		
		DateTime m_Validity;
		/// <summary>
        /// 
        /// </summary>
        public DateTime Validity
        {
            get { return m_Validity; }
            set { m_Validity = value; }
        }
		
		string m_Remarks;
		/// <summary>
        /// 
        /// </summary>
        public string Remarks
        {
            get { return m_Remarks; }
            set { m_Remarks = value; }
        }
		
		int m_Creater;
		/// <summary>
        /// 
        /// </summary>
        public int Creater
        {
            get { return m_Creater; }
            set { m_Creater = value; }
        }
		
		string m_CreatedBy;
		/// <summary>
        /// 
        /// </summary>
        public string CreatedBy
        {
            get { return m_CreatedBy; }
            set { m_CreatedBy = value; }
        }
		
		DateTime m_Created;
		/// <summary>
        /// 
        /// </summary>
        public DateTime Created
        {
            get { return m_Created; }
            set { m_Created = value; }
        }
		
		DateTime m_Modified;
		/// <summary>
        /// 
        /// </summary>
        public DateTime Modified
        {
            get { return m_Modified; }
            set { m_Modified = value; }
        }
		
		string m_ModifiedBy;
		/// <summary>
        /// 
        /// </summary>
        public string ModifiedBy
        {
            get { return m_ModifiedBy; }
            set { m_ModifiedBy = value; }
        }
		
		int? m_ModifiedByID;
		/// <summary>
        /// 
        /// </summary>
        public int? ModifiedByID
        {
            get { return m_ModifiedByID; }
            set { m_ModifiedByID = value; }
        }
		
		
		#region IDbSessionEntity Members
		public void ReadDBData(RowDataReader reader)
        {
            m_GiftCardsHistoryID = reader[TableGiftCardsHistory.GiftCardsHistoryID];
            m_GiftCardsID = reader[TableGiftCardsHistory.GiftCardsID];
            m_CardNumber = reader[TableGiftCardsHistory.CardNumber];
            m_Amount = reader[TableGiftCardsHistory.Amount];
            m_StatusID = reader[TableGiftCardsHistory.StatusID];
            m_Validity = reader[TableGiftCardsHistory.Validity];
            m_Remarks = reader[TableGiftCardsHistory.Remarks];
            m_Creater = reader[TableGiftCardsHistory.Creater];
            m_CreatedBy = reader[TableGiftCardsHistory.CreatedBy];
            m_Created = reader[TableGiftCardsHistory.Created];
            m_Modified = reader[TableGiftCardsHistory.Modified];
            m_ModifiedBy = reader[TableGiftCardsHistory.ModifiedBy];
            m_ModifiedByID = reader[TableGiftCardsHistory.ModifiedByID];
        }
		
		public void WriteDBData(RowDataWriter writer)
        {
            writer.SetPrimaryKey(TableGiftCardsHistory.GiftCardsHistoryID, PrimaryKeyType.Identity, GiftCardsHistoryID);
			writer[TableGiftCardsHistory.GiftCardsID] = GiftCardsID;
			writer[TableGiftCardsHistory.CardNumber] = CardNumber;
			writer[TableGiftCardsHistory.Amount] = Amount;
			writer[TableGiftCardsHistory.StatusID] = StatusID;
			writer[TableGiftCardsHistory.Validity] = Validity;
			writer[TableGiftCardsHistory.Remarks] = Remarks;
			writer[TableGiftCardsHistory.Creater] = Creater;
			writer[TableGiftCardsHistory.CreatedBy] = CreatedBy;
			writer[TableGiftCardsHistory.Created] = Created;
			writer[TableGiftCardsHistory.Modified] = Modified;
			writer[TableGiftCardsHistory.ModifiedBy] = ModifiedBy;
			writer[TableGiftCardsHistory.ModifiedByID] = ModifiedByID;
        }

        public void SetIdentityAfterInsert(DBObject idd)
        {
            m_GiftCardsHistoryID = idd;
        }
		
		public string TableName
        {
            get { return TableGiftCardsHistory.Table; }
        }
		#endregion
		
		#region IJsonClass Members

        public void JsonDeSerializeObj(JsonHashTable hashToRead)
        {
             m_GiftCardsHistoryID = hashToRead["GiftCardsHistoryID"];
			 
             m_GiftCardsID = hashToRead["GiftCardsID"];
			 
             m_CardNumber = hashToRead["CardNumber"];
			 
             m_Amount = hashToRead["Amount"];
			 
             m_StatusID = hashToRead["StatusID"];
			 
             m_Validity = hashToRead["Validity"];
			 
             m_Remarks = hashToRead["Remarks"];
			 
             m_Creater = hashToRead["Creater"];
			 
             m_CreatedBy = hashToRead["CreatedBy"];
			 
             m_Created = hashToRead["Created"];
			 
             m_Modified = hashToRead["Modified"];
			 
             m_ModifiedBy = hashToRead["ModifiedBy"];
			 
             m_ModifiedByID = hashToRead["ModifiedByID"];
			 
        }

        public void JsonSerializeObj(JsonHashTable hashToFill)
        {
            hashToFill["GiftCardsHistoryID"] = GiftCardsHistoryID;
			 
            hashToFill["GiftCardsID"] = GiftCardsID;
			 
            hashToFill["CardNumber"] = CardNumber;
			 
            hashToFill["Amount"] = Amount;
			 
            hashToFill["StatusID"] = StatusID;
			 
            hashToFill["Validity"] = Validity;
			 
            hashToFill["Remarks"] = Remarks;
			 
            hashToFill["Creater"] = Creater;
			 
            hashToFill["CreatedBy"] = CreatedBy;
			 
            hashToFill["Created"] = Created;
			 
            hashToFill["Modified"] = Modified;
			 
            hashToFill["ModifiedBy"] = ModifiedBy;
			 
            hashToFill["ModifiedByID"] = ModifiedByID;
			 
        }

        #endregion
		
	}
}
